package com.qf.config;

import com.qf.interceptor.NoLoginInterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

import javax.annotation.Resource;

/**
 * @Classname WebConfig
 * @Description TODO
 * @Date 2025/5/22 21:05
 * @Created by 26623
 * @auto
 */
@Configuration
public class WebConfig implements WebMvcConfigurer {

    @Resource
    private NoLoginInterceptor noLoginInterceptor;

    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(noLoginInterceptor)
                .addPathPatterns("/**");  // 拦截所有路径
    }
}
